//
//  UITextField+Custom.m
//  XGT
//
//  Created by DemonLee on 15/5/28.
//  Copyright (c) 2015年 Demon. All rights reserved.
//

#import "UITextField+Custom.h"
#import "JTCSM.h"

@implementation UITextField (Custom)
+ (UITextField *)initWithframe:(CGRect)frame backgrandColor:(UIColor *)backgrandColor placeholder:(NSString *)placeholder textAlignment:(NSTextAlignment)textAlignment font:(float)fontSize texcolor:(UIColor *)color{
    UITextField *textfield = [[UITextField alloc]initWithFrame:frame];
    if (backgrandColor == nil) {
        textfield.backgroundColor = [UIColor clearColor];
    }else{
        textfield.backgroundColor = backgrandColor;
    }
    textfield.placeholder = placeholder;
    [textfield setValue:[df colorWithHexString:@"999999" alpha:1] forKeyPath:@"_placeholderLabel.textColor"];
//    textfield.textColor = RGBACOLOR(100, 100, 100, .5);
    textfield.textAlignment = textAlignment;
    textfield.textColor = [UIColor blackColor];
    textfield.textAlignment = textAlignment;
    [textfield setFont:[UIFont systemFontOfSize:fontSize]];
    //[textfield setFont:[UIFont fontWithName:@"Helvetica-Bold" size:16.0]];
    //[textfield setFont:[UIFont systemFontOfSize:12.0]];
    return textfield;
}
@end
